<?php

namespace apiend\modules\download\controllers;

use Yii;
use apiend\components\Controller;
use apiend\modules\download\models\GoodsSearch;

/**
 * 商品信息相关下载接口
 * 
 * @author emhome <emhome@163.com>
 * @since 2.0
 */
class GoodsController extends Controller {

    /**
     * @inheritdoc
     */
    protected function verbs() {
        return [
            '*' => ['POST'],
        ];
    }

    /**
     * Renders the index view for the module
     * @return string
     */
    public function actionIndex() {
        $model = new GoodsSearch();
        $model->store_id = $this->storeId;
        $model->load(Yii::$app->request->post(), '');
        return $model->exportCsv();
    }

}
